$(function(){
	var arr={
		hf_s_id:"WD11",
		hf_srv_id:"Pv_jpo_list",
		hs_action_id:"get_list",
		hf_locale_id:"en"
	};
	getNoResultAjaxRequest(arr, function(result) {
		var pre_order_list='';
		for (var i=0;i<result.length;i++){
			pre_order_list+='<div class="item">'+
				'<img src="'+MPJ.apiBase+result[i].bs_p3_file_id+'" />'+
				'<div class="main">'+
					'<h4>'+result[i].bs_po_note+'</h4>'+
					'<div class="deadline">Order deadline: <strong>'+result[i].bs_po_end_dt+'</strong></div>'+
						'<a href="javascript:void(0)" class="terms">Terms & Conditions</a>'+
						'<a class="mui-btn mui-btn-block" data-id="'+result[i].bs_po_id+'">Order Now</a>'+
					'</div>'+
				'</div>';
		}
		$('.preOrderBox').html(pre_order_list);

		$('.preOrderBox a.mui-btn-block').on('tap',function(){
			var id=$(this).data('id');
			sessionStorage.setItem('perOrderId',id);
			location.href=MPJ.base+"/pages/pre-order-flower.jsp";
		})

	});
})